package Demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-03-15
 * Time: 21:25
 */
public class Dog extends Animal{
    int a = 2;
    public Dog(String name, int age) {
        super(name, age);//调用了父类的构造方法
        System.out.println("构造方法--Dog");
    }
    public void bark(){
        System.out.println("小狗在汪汪叫");
    }
    static {
        System.out.println("static--Dog");
    }
    {
        System.out.println("实例代码块--Dog");
    }
}
